read

The read command is used to read data points from a file or from standard input. Each column is assigned to a given vector. Vectors not already allocated will automatically be. Range of values can be specified on any variable using the [low:high] syntax. A `*' replacing a value will be taken as unexistent. Range of lines can be specified on any variable using the {low:high} syntax. The last line range given will be the only one in effect. If the file name specified is `' data will be read from the current standard input until the keyword end is found on a line by itself. The read and the load commands are recursive functions so they can be nested insofar as you can understand what is going on. An assignment consists in a vector name and a column number separated by a colon. After a file has been successfully read, read will put the name of the data file in string constant ReadFile.

read filename assignment[range]{linerange} ...

     read file1 X:1[0:*] Y:2
     read file2 TIME:2{100:400}
     read - T:1 VALUE:2
     1    2.3
     2    4.7
     .    .
     .    .
     .    .
     end
The first form will read positive values of the first column in vector X and corresponding values of the second in vector Y. The second will read the second column of file file2 from line 100 to line 400. The third will read T and VALUE from stdin. The assignment does not need to be in increasing order of column. Also note that the first column is 1.

exec, data